<include file="Public/min-header" />
<div class="wrapper">
    <section class="content">
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="navbar navbar-default">
                        <form action="{:U('Coupon/sendCoupon')}" id="search-form" class="navbar-form form-inline" method="post">
                            <div class="form-group">
                                <select name="level_id" id="level_id" class="form-control">
                                    <option value="0">所有会员</option>
                                    <foreach name="level" item="vo">
                                        <option value="{$vo['level_id']}" <if condition="$vo[level_id] eq $level_id">selected</if>> {$vo['level_name']}</option>
                                    </foreach>
                                </select>
                            </div>
                            <input type="hidden" name="cid" id="cid" value="{$cid}">
                            <button type="submit" id="button-filter" class="btn btn-info">确定发送优惠券</button>
                        </form>
                    </div>
                    <div class="navbar navbar-default">
                        <form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
                            <div class="form-group">
                                <label class="control-label" for="input-mobile" style = "width:80px">手机号码</label>
                                <div class="input-group">
                                    <input type="text" name="mobile" value="" placeholder="手机号码" id="input-mobile" class="form-control">
                                </div>
                            </div>
<!--                            <div class="form-group">
                                <label class="control-label" for="input-email"  style = "width:50px;margin-left:10px;">email</label>
                                <div class="input-group">
                                    <input type="text" name="email" value="" placeholder="email" id="input-email" class="form-control">
                                </div>
                            </div>-->
                            <div class="form-group mt-10">
                                <label class="control-label" for="input-order-id" style = "width:80px">昵称关键词</label>
                                <div class="input-group">
                                    <input type="text" name="nickname" value="{$nickname}" placeholder="搜索词" id="input-order-id" class="form-control">
                                </div>
                            </div>
                            <button type="button" onclick="ajaxGetTable('search-form2', 1)" id="button-filter search-order" class="btn btn-primary mt-10"><i class="fa fa-search"></i>查找</button>
                            <button type="button" onclick="doconfirm()" id="button-filter" class="btn btn-info pull-right mt-10">确定发送优惠券</button>
                        </form>
                    </div>
                    <form method="post" action="" id="form-user">
                        <input type="hidden" name="cid" id="cid" value="{$cid}">
                        <div id="ajax_return">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
    <script>
    $(document).ready(function() {
        ajaxGetTable('search-form2', 1);

    });

    // ajax 抓取页面
    function ajaxGetTable(tab, page) {
        cur_page = page;
        $.ajax({
            type: "POST",
            url: "/index.php/Admin/Coupon/ajaxGetUser/p/" + page,
            data: $('#' + tab).serialize(),
            success: function(data) {
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    }

    function doconfirm() {
        if ($("input[type='checkbox']:checked").length == 0) {
            layer.alert('请选择会员', {
                icon: 2
            });
            return false;
        } else {
            $('#form-user').submit();
        }
    }
    </script>
</div>
</body>

</html>
